package org.wm.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import org.quartz.SchedulerException;
import org.wm.domain.SysJob;
import org.wm.exception.job.TaskException;

import java.util.List;

/**
 * 定时任务调度信息 服务层接口
 * (已按照 Mybatis-Plus 混合模式进行改造)
 */
public interface ISysJobService extends IService<SysJob> {

    IPage<SysJob> selectJobPage(Page<SysJob> page, SysJob job);

    boolean pauseJob(SysJob job) throws SchedulerException;

    boolean resumeJob(SysJob job) throws SchedulerException;

    boolean deleteJob(SysJob job) throws SchedulerException;

    void deleteJobByIds(Long[] jobIds) throws SchedulerException;

    boolean changeStatus(SysJob job) throws SchedulerException;

    void run(SysJob job) throws SchedulerException;

    boolean insertJob(SysJob job) throws SchedulerException, TaskException;

    boolean updateJob(SysJob job) throws SchedulerException, TaskException;

    boolean checkCronExpressionIsValid(String cronExpression);
}